package com.zimin.cloud.mine.web.spring;

import com.zimin.shared.annotation.OpLog;
import org.aopalliance.aop.Advice;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.AbstractPointcutAdvisor;
import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;

/**
 * @author zimin
 * @since 2021/9/28 3:36 下
 */
@Deprecated
public class OpLogAnnotationAdvisor extends AbstractPointcutAdvisor{

    private final Advice advice;

    public OpLogAnnotationAdvisor() {
        this.advice = new OpLogInterceptor();
    }

    @Override
    public Pointcut getPointcut() {
        return AnnotationMatchingPointcut.forMethodAnnotation(OpLog.class);
    }

    @Override
    public Advice getAdvice() {
        return this.advice;
    }
}
